<?php
/**
 * Create By: PhpStorm
 * User: niechenguang
 * File: GetCircle.php
 * Date: 2017/1/2
 * Time: 23:13
 */

namespace app\api\model\page\note;

use app\api\model\dao\Note;
use app\api\model\dao\NotePraise;
use app\api\model\dao\NoteReply;
use app\api\model\data\note\NoteData;
use app\library\Error;
use app\library\Flag;
use app\library\PageBase;
use think\Exception;

class GetMineReplyNoteList extends PageBase
{

    private $objNote;
    private $objNoteReply;
    private $objNoteData;
    private $objNotePraise;

    public function __construct()
    {
        parent::__construct();

        $this->objNote = new Note();
        $this->objNoteReply = new NoteReply();
        $this->objNoteData = new NoteData();
        $this->objNotePraise = new NotePraise();
    }

    /**
     * page 入口
     *
     * @param $param
     * @return array
     * @throws Exception
     */
    public function excute($param)
    {

        if (empty($param['userid'])) {
            return $this->getRes(Error::ERR_PARAM);
        }

        $ret = $this->checkToken($param);
        $this->user_id = $param['userid'];

        $this->data['list'] = [];

        $arrNote = $this->objNoteData->replyNote($this->user_id, $this->offset, $this->limit);

        $this->data['list'] = $arrNote;

        return $this->getRes();
    }
}
